home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / SAT 2.4.0 / SAT / Demo ƒ / HeartQuest demo ƒ / gameGlobals.p < prev    next >
Encoding:
Text File  |  1997-02-16  |  4.1 KB  |  181 lines  |  [TEXT/PJMM]

  1. {=================================================}
  2. {========= GameGlobals, globals for HeartQuest ============}
  3. {=================================================}
  4.  
  5. { Example file for Ingemars Sprite Animation Toolkit. }
  6. { © Ingemar Ragnemalm 1992 }
  7. { See doc files for legal terms for using this code. }
  8.  
  9. { This file defines the resource numbers and global variables for HeartQuest.}
  10.  
  11. unit GameGlobals;
  12.  
  13. interface
  14.  
  15.     uses
  16. {$IFC UNDEFINED THINK_PASCAL}
  17.         Types, Quickdraw, Windows, Resources, Menus, ToolUtils, {}
  18.         TextUtils, 
  19. {$ENDC}
  20.         SAT;
  21.  
  22.     const
  23. {    Resource numbers}
  24.  
  25.         fileMenuRes = 1002;        { File menu }
  26.         editMenuRes = 1003;    { Edit menu }
  27.         gameMenuRes = 1004;    { Race menu }
  28.         highMenuRes = 1005;    { Highscores menu }
  29.         aboutAlrt = 1000;        { About box }
  30.         helpenemiesAlrt = 1001;{ Pictures of the enemies }
  31.         evaAlrt = 1002;            { The little secret alert. :-)}
  32.         theHighRes = 263;        { highscore window }
  33.         highDlog = 259;            { highscore name dialog box }
  34.         kSetStringsDialog = 129;
  35.  
  36. { File menu }
  37.  
  38.         fm_helpenemies = 1;
  39.         fm_setStrings = 2;
  40. {quit = 4, default}
  41.  
  42. { Edit menu }
  43.         em_undo = 1;
  44.         em_cut = 3;
  45.         em_copy = 4;
  46.         em_paste = 5;
  47.  
  48. { Game menu }
  49.         run = 1;
  50.         sound = 3;
  51.         macho = 5;
  52.         allowBG = 7;
  53.         fastAnimation = 8;
  54.         pause = 10;
  55.         abort = 11;
  56.  
  57. { highscore menu }
  58.         showhs = 1;
  59.         clearhs = 3;
  60.  
  61.  
  62. { Game area size: }
  63.  
  64.         xsize = 512 - 440; {Use offSizeH-xsize!}
  65. {ysize = 320; {Full height - use offSizeV instead}
  66.  
  67. {Number of bonus objects to get a bonus level}
  68.         kBonusLevelTresh = 5;
  69.  
  70. { Preference file description - see further scores.p! }
  71.         kPrefsFileName = 'HeartQuest Prefs';
  72.         kPrefCreator = 'AHjD';
  73.         kPrefType = 'pref';
  74.  
  75.     type
  76. {    EventPtr = ^EventRecord;}
  77.  
  78.         str15 = string[15];
  79.  
  80.         FeatRec = record
  81.                 sound: boolean;
  82.                 allowBG: boolean;
  83.                 plotFast: boolean;
  84.                 macho: boolean;
  85.                 player: str15;
  86.                 sweetString1, sweetString2: Str15;
  87.             end;
  88.         FeatPtr = ^FeatRec;
  89.         FeatHnd = ^FeatPtr;
  90.  
  91. {Indexes for strings}
  92.     const
  93.         aboutStrID = 1;
  94.         anonymousStrID = 2;
  95.         cantfindsysStrID = 3;
  96.         resmissingStrID = 4;
  97.         creatingprefStrID = 5;
  98.         cantcreateresStrID = 6;
  99.         cantopenprefStrID = 7;
  100.         cantcreateprefStrID = 8;
  101.         normalStrID = 9;
  102.         machoStrID = 10;
  103.         scoreStrID = 11;
  104.         bonusStrID = 12;
  105.         levelStrID = 13;
  106.         sureStrID = 14;
  107.         nobodyStrID = 15;
  108.         startgameStrID = 16;
  109.         startlevelStrID = 17;
  110.         pauseStrID = 18;
  111.         resumeStrID = 19;
  112.         nopictStrID = 20;
  113.         noclutStrID = 21;
  114.         nooffscreenStrID = 22;
  115.         pleaseuncheckStrID = 23;
  116.         endStrID = 24;
  117.         okStrID = 25;
  118.         yesStrID = 26;
  119.         noStrID = 27;
  120.         quitStrID = 28;
  121.         memerrStrID = 29;
  122.         noscreenStrID = 30;
  123.         satnopictStrID = 31;
  124.         nowindStrID = 32;
  125.         startbonusStrID = 33;
  126.         loadingStrID = 34;
  127.  
  128.     var
  129.         theHigh: WindowPtr; { Window ptrs. }
  130.  
  131. {    Menu handles.  There isn't any apple menu here, since TransSkel will}
  132. {    be told to handle it itself.}
  133.  
  134.         features: FeatHnd;        { Settings record. }
  135.  
  136.         fileMenu, editMenu, GameMenu, highMenu: MenuHandle;
  137.  
  138. {      Dummy Boolean.  This may be used for Memory Management, if desired }
  139.         dummy: Boolean;
  140.  
  141.         slask: OSerr;
  142.  
  143.         level: longint;
  144.         bonus: longint;
  145.  
  146.         playerPos: point; { Position of player, to make it possible for monsters to aim }
  147.  
  148.         pauseFlag: boolean;
  149.  
  150. {New booleans for deciding when a level is completed, and whether there is a bonus object active or not.}
  151.         levelCompleted, bonusObjectRunning: Boolean;
  152.  
  153. {Variables for handling bonus levels. I havn't decided if gotAllBonuses should be used for anything.}
  154.         bonusLevelRunning, gotAllBonuses: Boolean;
  155.         bonusesCollected: integer;
  156.  
  157.         lastMacho: Boolean; {features^^.macho förra game over}
  158.         lastHigh: Integer; {Platsen för förra highscore}
  159.  
  160.         fadeTo: RGBColor;    {Global color for CLUT fading}
  161.  
  162.         gAppFile, gPrefFile: Integer;    {Resource files}
  163.  
  164.     function MyGetIndString (index: integer): Str255;
  165.  
  166. implementation
  167.  
  168. {I know, it's ugly to have a routine in the globals file, but this is needed just}
  169. {about everywhere, so the alternative was to make a new unit.}
  170.  
  171. {MyGetIndString returns a string that it gets from STR# 128 (hard-coded)}
  172. {by GetIndString.}
  173.     function MyGetIndString (index: integer): Str255;
  174.         var
  175.             str: Str255;
  176.     begin
  177.         GetIndString(str, 128, index);
  178.         MyGetIndString := str;
  179.     end;
  180.  
  181. end.